package com.kuaidao.sys.controller.dictiondry;

import com.kuaidao.common.entity.JSONResult;
import com.kuaidao.common.entity.PageBean;
import com.kuaidao.sys.dto.dictionary.DictionaryItemReqDTO;
import com.kuaidao.sys.dto.dictionary.DictionaryItemResDTO;
import com.kuaidao.sys.service.dictiondry.IDictionaryEditionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * author Hao
 **/

@RestController
@RequestMapping("/dictionaryItem")
public class DictionaryItemController {

    @Autowired
    private IDictionaryEditionService iDictionaryEditionService;

    @PostMapping("/findDictionaryItemByPage")
    public JSONResult<PageBean<DictionaryItemResDTO>>  findDictionaryItemByPage(@RequestBody DictionaryItemReqDTO dictionaryItemReqDTO){

        List dictionaryItemsByPage = iDictionaryEditionService.findDictionaryItemsByPage(dictionaryItemReqDTO);

        PageBean pageBean=new PageBean(dictionaryItemsByPage);

        return new JSONResult<PageBean<DictionaryItemResDTO>>().success(pageBean);
    }






}
